package br.edu.ufam.controleAcesso

class Aplicacao {
    
    static auditable = true

    static mapping = {
        menu lazy:false
        id generator:'uuid'
    }
    
    String id
    String descricao
    String controle
    Date dtinicio
    Date dtfim
    Boolean ativo
    Boolean visivel = true

    Date dateCreated
    Date lastUpdated
    Usuario usuarioCreated
    Usuario usuarioUpdated

    static belongsTo = [menu:Menu]

    static constraints = {
        descricao(blank:false, maxSize:40, unique:true)
        controle(blank:false, maxSize:40, unique:true)
        ativo(nullable:true)
        dtinicio(blank:false)
	dtfim(blank:false)
    }

    String toString(){        
        "${descricao}"
    }

}
